//
//  XMRechargeCollectionViewCell.m
//  XunMi
//
//  Created by MacBook on 2024/2/29.
//  Copyright © 2024 TieZhu. All rights reserved.
//

#import "XMRechargeCollectionViewCell.h"
#import "XMRechargeModel.h"

@interface XMRechargeCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIView *bgV;
@property (weak, nonatomic) IBOutlet UIImageView *bgImgV;
@property (weak, nonatomic) IBOutlet UIButton *goldBtn;
@property (weak, nonatomic) IBOutlet UILabel *firstLa;
@property (weak, nonatomic) IBOutlet UILabel *priceLa;
@property (weak, nonatomic) IBOutlet UILabel *tehuiLa;


@end

@implementation XMRechargeCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    kCornerRadius(_tehuiLa, 4, 0, UIColor.clearColor);
    kCornerRadius(_bgV, 10, 0, UIColor.clearColor);

}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.goldBtn setImagePosition:XMImagePositionRight spacing:2];
}

- (void)setModel:(XMRechargeModel *)model {
    _model = model;
    [self.goldBtn setTitle:kValueToString(model.golds) forState:UIControlStateNormal];
    self.priceLa.text = kStringFormat(@"¥%@", model.money);
    self.firstLa.text = kStringFormat(@"首冲送%@金币", model.give_golds);
    self.firstLa.hidden = [XMUtil isBlankString:kValueToString(model.give_label)];
    self.goldBtn.selected = model.selected;
    self.bgImgV.hidden = !model.selected;
    self.tehuiLa.hidden = [XMUtil isBlankString:model.give_label];
}

@end
